<template>
	<view class="box">
		<view class="box-top" style="display: flex;">
			<view style="width: 20%;" class='arrow'>
				<img @click='retu()' src='http://127.0.0.1:7001/public/activity/jiantou.png'>
			</view>
			<view style="width: 60%;" class='activity'><span>彩活动</span></view>
			<view style="width: 20%;" class='signup'>
				<span :style="`color:${this.value==''?'#999':'coral'}`" @click='confirm()'>确认</span>
			</view>
		</view>
		<!-- 输入框 -->
		<view class="shuru">
			<u-input v-model="value" :type="type" :border="border" :height="height" :auto-height="autoHeight" />
		</view>
		<!-- 消息提示 -->
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				type: 'textarea',
				border: false,
				height: 700,
				autoHeight: true,
			}

		},
		methods: {
			retu(value) {
				uni.switchTab({
					url: '../course'
				})
			},
			confirm() {
				if (this.value !== '') {
					uni.$emit('value', {
						value: this.value,
					})
					this.value =''
					uni.navigateBack({
						delta: 1
					})
				}
			}
		},

	}
</script>

<style lang="scss">
	.box {
		width: 100%;
		height: 730px;
		background: #fcf8f8;

	}

	// 头部
	.box-top {
		width: 100%;
		height: 10%;
		border-bottom: 1px solid coral;

		.arrow {
			img {
				width: 26upx;
				margin: 40upx 30upx;
			}
		}

		.activity {
			span {
				display: block;
				text-align: center;
				line-height: 130upx;
				font-size: 35upx;
			}
		}

		.signup {
			span {
				display: block;
				text-align: center;
				line-height: 135upx;
				font-size: 33upx;
			}

		}
	}

	// 输入
	.shuru {
		width: 100%;
		height: 30%;
		background: white;
	}
</style>
